home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / EXT / P-T / ShutDowner.sit / ShutDowner / ShutDowner.c < prev    next >
C/C++ Source or Header  |  1993-03-15  |  561b  |  34 lines

  1. #include <ShutDown.h>
  2. #include <Events.h>
  3.  
  4. extern void SHOWINIT();
  5. #define IconID 128
  6. #define ShutDownkey 0x77    /* 'end' key */
  7.  
  8. /*
  9.     shift - 0x38
  10.     control - 0x3B
  11.     esc - 0x35
  12. */
  13.  
  14. void
  15. main(void)
  16. {
  17.     long key[4];
  18.     unsigned char *theKeys;
  19.     
  20.     GetKeys(key);
  21.     
  22.     theKeys = (unsigned char *)(key);
  23.         
  24.     if ((theKeys[((unsigned short)(ShutDownkey)) >> 3] >> (((unsigned short)(ShutDownkey)) & 7)) & 1)
  25.         ShutDwnPower();
  26.  
  27.     asm    /* show init */
  28.     {
  29.                 move.w    #IconID,-(sp)            ; load ICN# ID
  30.                 move.w    #-1,-(sp)                ; use default moveX
  31.                 bsr        SHOWINIT                ; draw the icon
  32.     }
  33.  
  34. }